package com.example.controller;

import com.example.entity.PointDefend;
import com.example.service.PointDefendService;
import com.example.service.SpotCheckItemService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 积分维护表
 */
@RestController
@RequestMapping("api/pointDefend")
public class PointDefendController {

    @Autowired
    public SpotCheckItemService potCheckItemService;

    @Autowired
    public PointDefendService pointDefendService;


    /**
     * 查询数据
     */

    @ApiOperation(value = "查询积分维护表的所有数据", notes = "查询积分维护表的所有数据")
    @RequestMapping(value = "findList", method = RequestMethod.POST)
    private Map<String, Object> findList(@RequestBody PointDefend pointDefend) {
        Map<String, Object> resultMap = pointDefendService.findList(pointDefend);
        return resultMap;
    }

    /**
     * 保存数据
     */
    @ApiOperation(value = "保存积分维护规则", notes = "保存积分维护规则")
    @RequestMapping(value = "insertPointDefend", method = RequestMethod.POST)
    private Map<String, Object> insertPointDefend(@RequestBody PointDefend pointDefend) {
        Map<String, Object> resultMap = pointDefendService.insertPointDefend(pointDefend);
        return resultMap;
    }

    /**
     * 批量删除数据
     */
    @ApiOperation(value = "批量积分维护规则", notes = "批量积分维护规则")
    @RequestMapping(value = "deletePointDefend", method = RequestMethod.POST)
    private Map<String, Object> deletePointDefend(@RequestBody Map map) {
        Map<String, Object> resultMap = pointDefendService.deletePointDefend(map);
        return resultMap;
    }

    /**
     * 修改数据
     */
    @ApiOperation(value = "修改积分维护规则", notes = "修改积分维护规则")
    @RequestMapping(value = "updatePointDefend", method = RequestMethod.POST)
    private Map<String, Object> updatePointDefend(@RequestBody PointDefend pointDefend) {
        Map<String, Object> resultMap = pointDefendService.updatePointDefend(pointDefend);
        return resultMap;
    }


}
